home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Textfiles / zines / hir / hir6 Folder.sit / hir6 Folder / hir6-7.txt < prev    next >
Text File  |  1998-07-09  |  34KB  |  689 lines

  1.                                     HiR 6
  2.               Windows 95: User Friendly means Hacker Friendly
  3.                                    by Axon
  4.  
  5. Everyone knows that Windows 95 is extremely insecure.  I would argue that if
  6. you're going to plop Windows 95 on a machine in a public place, you might as
  7. well put a sticky note on the monitor that proclaims "Hack Me!".  From the
  8. very genesis of Windows, it's been a huge hacker target.  Microsoft has tried
  9. their damnedest to make it more secure, but even with the way Windows can use 
  10. the "magic" registry mechanism for "security", there are still many holes
  11. that need help.  Even the registry has its holes.  In this article, I'll
  12. discuss several of the little inner workings that lie under the "gee whiz"
  13. graphical loser interface that Bill stole from other companies anyway. 
  14.  
  15. In short: Many things that add power or ease of use to Windows will also
  16. decrease privacy and security:
  17.  
  18. I.    The registry
  19.        a. Why the registry is so good for security
  20.        b. Registry keys that are used for security
  21.        c. Why the registry's "security" features mean absolutely nothing
  22.  
  23. II.   OLE (Object Linking and Embedding)
  24.        a. OLE features that make the user cheer "OLE!"
  25.        b. Why OLE opens up some major security holes
  26.  
  27. III.  Windows 95 Login Screen (Secure?  I'd doubt it.)
  28.  
  29. IV.   Windows 95 AutoRun
  30.        a. Advantages
  31.        b. Problems
  32.        c. Disabling AutoRun
  33.  
  34. V.    Help
  35.        a. Useful applications for Windows Help
  36.        b. Windows help needs to practice what it preaches
  37.  
  38. VI.   Find (A great utility, but...)
  39.  
  40. VII.  Boot Menu
  41.        a. Explanation of the Boot Menu
  42.        b. Dangers of the Boot Menu
  43.        c. Customizing MSDOS.SYS (Contains Boot Menu Information)
  44.  
  45. Appendix A: Advanced Registry Fun
  46.  
  47. Appendix B: Some final stuff
  48.  
  49. Closing Remarks on Windows 95 Security
  50.  
  51. ------------------------------------------------------------------------------
  52. In long:  I'll expand on that outline, but keep its structure.
  53.  
  54. I.  The registry
  55.  
  56.      The registry is a good idea.  It does everything from getting rid of the
  57.      need for .INI files for Windows programs, to keeping track of what 
  58.      applications should be used for each file extension type (which was its
  59.      only function in Windows 3.x).  In windows 95 and NT, it's even an okay
  60.      security mechanism.  If you find this section interesting, then I'd
  61.      suggest checking out Appendix A of this article, "Advanced Registry Fun"
  62.      which covers more complex registry toys.  Note: Due to the power that is
  63.      held within the registry, I am telling you now: "Back up your registry
  64.      before you play with it, EACH AND EVERY TIME YOU PLAY WITH IT!!!"  This
  65.      is easily accomplished by running Regedit.exe, and selecting the file
  66.      menu, and exporting your registry file.  I usually save it with the
  67.      date, such as 6-3-98.reg.  if your registry gets messed up, it is easy
  68.      to blow away and restore it with this backup.  Also, looking at this
  69.      backup with a text editor will show you a great example of a huge
  70.      registry patch file (see below).
  71.  
  72.   a. Why the registry is good for security
  73.      It would seem like the ideal way to enforce security permissions: Alter 
  74.      the registry so that it no longer allows certain things to be done 
  75.      anymore, and then, throw in a registry value that keeps the user from
  76.      running the registry editor.
  77.  
  78.   b. A registry patch file is one of several ways to make "Cookie-Cutter"
  79.      changes to the registry (I will cover a more advanced method of creating
  80.      registry-editing files, .INF files) in Appendix A, Advanced Registry 
  81.      Fun).  The first line of any registry patch file is "REGEDIT4".  The 
  82.      keys are stored in registry patch files in the following format:
  83. --
  84. REGEDIT4
  85.  
  86.       [HKEY_...\PATH\WITHIN\REGISTRY\TREE\TO\KEY1]
  87.       
  88.       "NameOfKey1Value1"=dword:xxxxxxxx    (Hexadecimal)
  89.      
  90.       [HKEY_...\PATH\WITHIN\REGISTRY\TREE\TO\KEY2]
  91.  
  92.       "NameOfKey2Value1"="blahblah"        (String value, text)
  93.       "NameOfKey2Value2"=dword:xxxxxxxx    (Hexadecimal)
  94.       "NameOfKey2Value3"=hex:ff,00,20,1c...(Hexadecimal Bytes)
  95.       "NameOfKey2Value4"=dword:xxxxxxxx    (Hexadecimal)
  96.       "NameOfKey2Value5"=dword:xxxxxxxx    (Hexadecimal)
  97.  
  98. --
  99.      You get the picture...
  100.  
  101.      Here are some of the registry keys and values used for security. These
  102.      values are mostly policy values.  I will explain a LOT more on policies
  103.      at the end of this article. (values are all DWord.) 00000000 is 
  104.      basically a "No" and 00000001 is basically a "Yes" for these values. 
  105.      This is not true with ALL the values in the registry! This is true with
  106.      the values listed here, though.  All of the following values are DWORDs,
  107.      not Hex or String. 
  108.      
  109.      You can probably figure out what most (or some) of these values do:
  110.      I'll explain some archaic values in ()'s next to the value.
  111.  
  112.      HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
  113.          \Explorer
  114.             * NoAddPrinter
  115.             * NoDeletePrinter
  116.             * NoSaveSettings
  117.             * NoRun ("Run" item doesn't show up in Start Menu if 00000001)
  118.  
  119.      HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
  120.          \Network
  121.             * NoNetSetup (Won't let ya use "Network" from control panel)
  122.             * NoFileSharingControl
  123.             * NoPrintSharingControl
  124.             * NoEntireNetwork (Can't see entire network on Net 'hood)
  125.             * DisablePwdCaching (stuff you type in Run doesn't stay in the
  126.                                  list box below.)
  127.  
  128.      HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
  129.          \System (Stuff under System/Display Properties Control panels)
  130.             * NoDispCPL
  131.             * NoDispScrSavPage
  132.             * NoDispSettingsPage
  133.             * NoSecCPL
  134.             * NoDevMgrPage
  135.             * NoConfigPage
  136.             * NoFileSysPage
  137.             * NoVirtMemPage
  138.             * DisableRegistryTools (Keeps regedit from being run...kinda)
  139.  
  140.   c. Why the registry's security features mean nothing.
  141.      The registry editor might not allow you to open it and screw with the
  142.      underlying registry (thanks to the DisableRegistryTools value) but the
  143.      funny thing is that you can create registry patches (using the format I
  144.      described above) and name them with a .REG extension.  If you double
  145.      click on a .REG file, the registry editor reads the registry patch file
  146.      and des a "merge", or in other words, changes the values contained in
  147.      the registry to match the ones in the patch file.  This means fun for
  148.      the little guys!  Here's a snippit from my favorite registry patch file
  149.      that I keep on my Windows 95 disk o' death (anything in parenthesis 
  150.      isn't part of the registry patch.  Square brackets ARE a part of the
  151.      patch!!!).  Here we go:
  152.  
  153.      ----------------------< Cut Edit-reg.REG >-----------------------
  154. REGEDIT4
  155. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
  156.  
  157. "DisableRegistryTools"=dword:00000000  (Lets us use the regedit now)
  158.  
  159.      ----------------------< Cut >------------------------------------
  160.  
  161.      If you double click on Edit-Reg.REG (Or double click a link to it via 
  162.      OLE), you will be able to launch registry editor without the "Registry
  163.      Editing has been disabled..." message.  The rest of the system is yours
  164.      once you "adjust" the setting for those other values I listed in section
  165.      Ib.
  166.  
  167.      By the same token, replacing the 00000000 with 00000001 in the
  168.      "DisableRegistryTools" value in the registry itself, or in the patch
  169.      file (of course you need to run the patch file first) will disallow
  170.      access to registry-altering tools such as regedit. This is why the
  171.      registry needs some work.  How do you fix it?
  172.  
  173.      I would advise giving technicians a copy of regedit.exe (and other stuff
  174.      like a registry patch file like this one) on a floppy disk, and erase 
  175.      regedit.exe from the machines.  Regedit accepts command line arguments,
  176.      running "A:\regedit.exe a:\Edit-Reg.REG" will then allow the technician
  177.      to run "A:\regedit.exe", then edit the registry for that system.  (Then,
  178.      before quitting the registry editor, modify the DisbleRegistryTools value
  179.      again, or run another patch to lock the registry down again.)  Secure? If
  180.      someone has a copy of regedit.exe on a floppy and can fabricate a patch
  181.      (not hard to do, as shown above) then you're not much better off.
  182.  
  183.  
  184. II.  OLE (Object Linking and Embedding)
  185.  
  186.   a. OLE features that make the user cheer "OLE!"
  187.      OLE isn't necessarily a bad thing. It allows tons of funky things to be
  188.      done, such as throwing a digital image into a plain-old text document.
  189.      Introduced full-force in win3.x, it was very similar to what the people
  190.      at APPLE had been toying with for a while.  Add sounds to your documents
  191.      or plop part of your spreadsheet into a fiscal report for your boss, and
  192.      even attach a whole file to the essay you e-mailed to your English
  193.      teacher!  OLE handles 2 types of connection methods, Linking and
  194.      Embedding (imagine that...).  Linking will not place a copy of the
  195.      linked document into the work in progress.  It merely points to it on
  196.      the current computer.  Any changes you make to the linked file will be
  197.      reflected equally in any document that it is linked to. Embedding a file
  198.      places a copy of the embedded file INTO the work in progress.  Any
  199.      changes made to the embedded part do not have any effect on the original
  200.      file, nor do changes to the original have an effect on the embedded one.
  201.      You use OLE often when doing clipboard operations such as cut, copy and
  202.      paste.  OLE is not a bad thing...at first glance... 
  203.  
  204.   b. Why OLE opens some major security holes
  205.      OLE allows you to attach or link to almost any file that Windows knows
  206.      how to handle.  One can link to a bitmap file and Windows will access
  207.      Paintbrush, and use it to show the bitmap as if it were PART of the
  208.      document.  If an executable file is embedded, it will be handled like
  209.      Windows normally handles an executable (runs it).  Granted, some times
  210.      command.com still won't work (This is a registry thing again... See 
  211.      "Advanced Registry Fun, Appendix A of this article.), but there are still
  212.      a lot of things you can pull off.  I know of no workaround for problems
  213.      with OLE, because it's impossible (I think) to disable it.  Frogman is
  214.      experimenting with the idea of removing OLE from Windows.  This far, he's
  215.      seeing that apps which do not require OLE to function work fine, but
  216.      many programs use OLE to ovcmmunicate between modules, as well.  These
  217.      programs do not run properly, and sometimes not at all.  It is a hypo-
  218.      thesis that if a secure system is needed, anti-OLE mods can be made, and
  219.      specially chosen software programs (which don't require OLE).  Perhaps
  220.      an article on anti-OLE techniques later, if we find a decent way to pull
  221.      it off...
  222.  
  223.  
  224. III. Windows 95 Login Screen
  225.      I really don't have a lot to say about the login screen.  It is an 
  226.      extremely pathetic (almost worthless) security mechanism.
  227.      It's basically good for each user having a customized desktop.  By 
  228.      hitting the Windows key (CTRL-ESC), you can launch the task manager, and
  229.      go to the file menu, select "RUN", and browse through anything you'd 
  230.      want to run. A fun thing is to run "explorer.exe", as this is what 
  231.      creates the desktop environment.  Granted, you still have a login
  232.      dialog box on-screen, but you have a desktop and start menu.  Often
  233.      enough, if the system is REALLY insecure, you do not even need to go 
  234.      through that mess.  Just hit the escape key at the login and it'll give
  235.      you a desktop.  Fun stuff.  To fix this, there are 2 paths to be taken.
  236.      If your system does not give a desktop when escape is hit at the login,
  237.      all you must do is delete taskman.exe out of the C:\Windows folder.  As
  238.      long as A:\ isn't in your path (so that someone with taskman.exe on a
  239.      floppy could still use this bug), you should be secure in this aspect.
  240.      If your login screen gives up the desktop when escape is pressed, then
  241.      you need to not only erase taskman.exe, but you must either modify the
  242.      registry to disallow this behavior, or modify the desktop settings so
  243.      that it is locked down in the registry and nothing can be run from
  244.      within the default desktop.
  245.  
  246.  
  247. IV.  Windows AutoRun
  248.      AutoRun is a feature that was introduced in Windows 95.  It senses when
  249.      a CD is inserted into the CD-ROM drive, then scans the root directory
  250.      of the CD for a file called AUTORUN.INF.  This file contains only a
  251.      file name and an extension.  No path, just a file name.  This is usually
  252.      (but not limited to being) an executable that is found in the root of
  253.      the CD-ROM.  If AutoRun is enabled, Windows opens (or runs) the file.
  254.  
  255.   a. AutoRun is obviously a very handy thing.  Programs that use AutoRun
  256.      will seem to launch themselves when you insert the CD-ROM.  Some pro-
  257.      grams will launch a menu that allows you to install the software (in
  258.      case it isn't installed yet), change installation options, launch the
  259.      program, or quit.  The original idea behind this feature was to add yet
  260.      another level of convenience and ease-of-use.  
  261.  
  262.   b. AutoRun can spell disaster for your dreams of a secure computer.  Not
  263.      only does it allow people to walk up to your system and install a game
  264.      they bought down the street somewhere with ease, even if they can't SEE
  265.      the CD-ROM drive, or run an install program; there are several other 
  266.      problems that AutoRun introduces.  One that is less obvious than most is
  267.      that AutoRun is willing and able to bypass the screensaver password (if
  268.      one exists), bomb out of the screensaver, and run whatever it was that
  269.      the AUTORUN.INF file points to.  This is an easy way around a screen
  270.      saver password.  Also, with the advent of CD-ROM Writers (Burners), 
  271.      and the falling prices of the same, more and more people (hackers,
  272.      crackers, little kids with rich parents, etc) are getting ahold of 'em.
  273.      Those who can program worth a darn could easily make their custom
  274.      program run as soon as they inserted the CD-ROM they just burned, just
  275.      by making AUTORUN.INF point to it.  Do you REALLY want anyone to be 
  276.      able to run whatever they can program/copy on your computer?
  277.  
  278.   c. Disabling AutoRun
  279.      On my desktop, I leave AutoRun enabled.  It's convenient.  But when I
  280.      am trying to secure a system, this is not a hole I wish to leave un-
  281.      scathed.  It takes me all of 30 seconds (or less) to disable AutoRun,
  282.      and it'll probably be one of the quickest security modifications you
  283.      will make.  The first step is to get to System Properties.  This is
  284.      done by right clicking on the "My Computer" icon, and selecting the
  285.      "Properties" item on the pop-up menu, or by selecting "System" from
  286.      the Control Panel.   Next, choose the "Device Manager" tab.  Find
  287.      "CDROM" on the Device Manager tree, and expand it (by clicking the +
  288.      sign to the left of it).  This shows a list of all CD-ROM devices
  289.      attached to your system.  Select the CD-ROM that you want to disable
  290.      AutoRun on, and click the "Properties" button.  Then, click on the
  291.      "Settings" tab.  The check box labeled "Auto Insert Notification"
  292.      is the key here.  If it is checked (which it probably is), then
  293.      AutoRun is enabled.  Uncheck it to disable AutoRun.  This is one
  294.      of those settings that don't get read in again until the system is
  295.      restarted.  If you have other modifications to moke, make them
  296.      before restarting (or else you'll probably reboot 4 or 5 times).
  297.      If you want to (re) enable AutoRun, it should be fairly obvious how
  298.      to do it.
  299.  
  300.  
  301. V.   Help
  302.   a. Help is a very useful aspect of Windows programs.  It's like having a 
  303.      personal online quick reference for many of the programs.  When you 
  304.      select a help screen (or when you press F1 while on the desktop), one of
  305.      two programs are usually executed: WINHELP.EXE or WINHLP32.EXE in the
  306.      Windows folder.  Pressing F1 at the desktop will give you a very large
  307.      and possibly exhaustive database of answers about various user-level
  308.      Windows stuff.  It has a very powerful find utility that allows the user
  309.      to quickly seek answers, and to do so with quite a bit of speed.  Very
  310.      handy, indeed.
  311.  
  312.   b. Sometimes, however, Windows' help facility can "help" a little too much,
  313.      for instance it can "help" people circumvent those restrictions that
  314.      you've worked so hard to fortify.  By searching for the right help 
  315.      topics, such as help topics on installing software, one might be able to
  316.      navigate the hard drive, delete files, and even execute any file on the
  317.      system, including things on floppy disk. This is very bad.  The only way
  318.      to get around this is by deleting the Windows help executables: 
  319.      WINHELP.EXE and WINHLP32.EXE in the C:\Windows folder.  Not always the
  320.      best way, as this will disable Windows' help, and most likely help will
  321.      not work in many other aplications, either.
  322.  
  323.  
  324. VI.  Find
  325.      Find is a great utility for locating those files that get lost in the
  326.      maze of your hard drive's directory structure.  It can be accessed by
  327.      pressing the F3 key when you're at the desktop.  Find, similar to help,
  328.      can also sometimes allow people to run illicit programs, delete files,
  329.      or copy stuff from your system to a floppy disk.  The only workaround I
  330.      know of is to remove the find option from the start menu (Another 
  331.      registry toy I'll discuss in Appendix A), and then rip the F3 key off 
  332.      of your keyboard.  This can be circumvented by a psycho who brings in
  333.      a keyboard when trying to take over your machine.
  334.  
  335.  
  336. VII. Boot Menu
  337.   a. Explanation of the Boot Menu.
  338.      The Boot Menu is a menu that is accessed a few different ways.  It is
  339.      most commonly accessed when Windows Does not start all the way up, and
  340.      the boot menu prompts for a safe-mode boot, but the user can choose what
  341.      boot option to proceed with.  This menu is also accessible by pressing
  342.      the F8 key right when the computer starts to load Windows 95 (if you see
  343.      the splash screen, it's too late).  This allows access to a normal DOS
  344.      mode session, which is typically option #6 on the menu.  Sometimes this
  345.      is a good option if some of your DOS apps just don't like Windows.
  346.  
  347.   b. Dangers of the Boot Menu
  348.      Hackers will often try to reboot the computer and use F8 to get into
  349.      a DOS session (where Windows' petty security settings haven't even been
  350.      enforced).  This is an extremely dangerous hole, in that any monkey with
  351.      half a brain could look through anyone else's stuff, and Crackers could
  352.      format your hard drive or plant viruses with ease.  When Windows 95 is
  353.      booted into safe mode, ALL policy setting are TOTALLY IGNORED.  This is
  354.      a Bad Thing, as almost all of your security settings have temporarily
  355.      (or permanently, assuming the user knows his stuff) bitten the dust.
  356.  
  357.   c. Modifying MSDOS.SYS (Which contains Boot Menu options)
  358.      MSDOS.SYS is a hidden system file, usually found in the root directory
  359.      of the Booting Hard Drive.  You will need to change its attributes in
  360.      order to edit it.  This is done with the "attrib" command.  If you don't
  361.      know how to use it, read a DOS manual, and it'll help you out. This is
  362.      what a typical MSDOS.SYS file looks like:
  363.  
  364. [Paths]
  365. UninstallDir=C:\
  366. WinDir=C:\WINDOWS
  367. WinBootDir=C:\WINDOWS
  368. HostWinBootDrv=C
  369.  
  370. [Options]
  371. BootGUI=1
  372. DoubleBuffer=1
  373. Network=1
  374. ;
  375. ;The following lines are required for compatibility with other programs.
  376. ;Do not remove them (MSDOS.SYS needs to be >1024 bytes).
  377. ;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxa
  378. ...(File continues with xxxxxxxxxx...ending in letters a-s)...
  379. ;xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxs
  380.  
  381.  
  382.      It is not hard to disable the F8 (and other) keys while booting.  All you
  383.      need to do is to add a line under [Options] saying "BootKeys=0".  It is
  384.      still possible to induce a Boot Menu by restarting the computer, then
  385.      pressing the RESET button or turning it off and back on again while the
  386.      Splash screen is still up (Windows 95 still loading).  You can also add
  387.      another line saying "BootMenuDelay=1" so that the menu will only appear
  388.      for 1 second.  If you set this to 0, the boot menu will display for an
  389.      indefinite period of time.  Below is a full table of all (that i know of)
  390.      options that can be placed under the [Options] section of MSDOS.SYS.
  391.  
  392.      BootMulti=         If set to 1, allows booting into previous operating
  393.                         System with the F4 Key.  Default is 0.
  394.  
  395.      BootDelay=n        Initial Delay before boot (This Determines how many
  396.                         Seconds the user is given to hit a Startup Key such
  397.                         as F4 or F8, before the system boots)  Default is 2.
  398.  
  399.      BootMenu=          If Set to 1, Boot menu Will appear whenever the
  400.                         Machine is booted up.  Default is 0.
  401.  
  402.      BootMenuDefault=   This sets the default menu item on the Boot Menu.
  403.                         Look at the boot menu if you want to know what all the
  404.                         options are on your machine.
  405.  
  406.      BootMenuDelay=n    This sets the number of seconds that the boot menu
  407.                         will wait for a user to enter an option before using
  408.                         the default option as set with BootMenuDefault.
  409.                         Default is 30 seconds.
  410.  
  411.      BootKeys=          When set to 1, Boot Keys are enabled.  When set to 0,
  412.                         User cannot use boot keys to access boot menu.
  413.                         Default is 1.
  414.  
  415.      BootGUI=           When set to 1, Machine boots into windows mode.  If
  416.                         Set to 0, machine will always boot into DOS mode.
  417.                         Default is 1.
  418.  
  419.      Logo=              If set to 1, The Splash Screen logo will appear while
  420.                         Machine starts up.  If set to 0, no logo will be
  421.                         displayed on startup.  Default is 1.
  422.  
  423.      BootWarn=          Enables starting in SafeMode without warning.  Default
  424.                         is 1.
  425.  
  426.      DoubleBuffer=      Enables Double-Buffering driver for SCSI controllers.
  427.                         Default is 0.
  428.  
  429.      Network=           Enables Safe Mode with Networking as a Boot Menu
  430.                         option.  Default is 0.
  431. ------------------------------------------------------------------------------
  432. Apendix A: Advanced Registry Fun
  433.  
  434. The registry contains more power than the human mind can comprehend. Through
  435. it, a lot of very scary things may be accomplished, as well as quite a few
  436. useful things.  At any rate, This section is not for people who just started
  437. learning about the registry as they read the first part of this article.  I
  438. strongly urge you to back up your registry before you do anything here.
  439.  
  440. The first thing I really must explain is the idea of policies.  Microsoft
  441. has a "policy editor" called "poledit.exe" which is basically a cheap-ass
  442. cheesy, user-friendly registry editor that edits a very small and specific
  443. portion of the registry that contains policy information.  It also creates
  444. ".POL" files, where a handfull of other elusive policies are stored.  I don't
  445. intend on covering the Policy Editor, though.  In my eyes, the policies are 
  446. easier to edit with the registry editor (or through patches) than through the
  447. policy editor.  If you know the locations of each policy key and can remember
  448. what subkeys and values are under the policies, then you'll be in good shape.
  449. More likely than not, you'll have to create the policy keys and values in the
  450. registry editor.  They won't already be in place.  If they are, someone knew
  451. what they were doing.
  452.  
  453. The policy key is actually locted in:
  454. HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies
  455. There are 4 Subkeys under policies: Explorer, Network (If the computer is
  456. networked), System, and WinOldApp.  For those of you who still aren't
  457. getting this, I'll do a little tree thing:
  458.  
  459. HKEY_CURRENT_USER
  460.    |
  461.    Software
  462.       |
  463.       Microsoft
  464.          |
  465.          Windows
  466.             |
  467.             CurrentVersion
  468.                |
  469.                Policies
  470.                   |
  471.                   Explorer
  472.                   Network
  473.                   System
  474.                   WinOldApp
  475.  
  476. In this segment, We'll only be dealing with stuff under policies, as this
  477. alone is a very powerful part of the registry.  There are other parts as
  478. well, but I would need to write a novel if i were to cover it all.  I
  479. won't talk about an HKEY path anymore.  I'll just talk about "This and
  480. that value under the Explorer subkey".  Remember, if the policies key and
  481. the 4 subkeys under it don't exist, then CREATE THEM in the place I said
  482. they should be.
  483.  
  484. Locking Down the default user (When ESCAPE is pressed at login screen).
  485.   HKEY_USERS contains a list of all users with accounts on the machine.
  486.   when expanded, there is a list of subkeys that, when the user logs on,
  487.   will become the structure of HKEY_CUERRENT_USER key.  By editing the
  488.   .default user under HKEY_USERS, you can lock down the default desktop
  489.   to allow next to nothing to occur.
  490.  
  491. Restricting Programs From Being Executed.
  492.   Restricting the command prompt is somewhat easy, but I'll tell you that
  493.   restricting executables is extremely messy.  This does not work the
  494.   way you think it should, though.  You can specify what executables
  495.   you want to be able to run, and all others will be locked out.  There
  496.   is no way to lock out a handfull of specific applications.  The value
  497.   that locks down executables is the "RestrictRun" Value under the
  498.   Explorer subkey.
  499.   
  500.   When RestrictRun is set to 0, no execute restrictions are placed into
  501.   effect.  If RestrictRun is set to 1, restrictions are placed into
  502.   effect.  Before you take off and enable this, please be sure to set
  503.   the names of programs you wish to allow run access.  These are values
  504.   labeled 1, 2, 3, 4, etc. These are string values under the RestrictRun
  505.   SUBKEY of the Explorer Subkey.  Do not confuse this with the value by
  506.   the same name.  I'll do a Mini-Tree (this one just goes back to the
  507.   policies key, not all the way back to the HKEY)
  508.               ...
  509.                Policies
  510.                   |
  511.                   Explorer ------------> RestrictRun=0x00000001 (1)
  512.                      |
  513.                      RestrictRun ------> 1="Niceprog.exe"
  514.                                  |       2="Regedit.exe"
  515.                                  |       3="cdplayer.exe"
  516.                                  ------> 4="telnet.exe"
  517.  
  518.   A registry patch that would lock out all software except for regedit,
  519.   poledit (Policy editor), netscape, wordpad, and explorer would look
  520.   like this:
  521.  
  522. (This is a file snippit.  Text may run off the right margin.  Please look
  523. carefully at this segment)
  524. ----------------------------<Software-lock.reg>-------------------------------
  525.  
  526. REGEDIT4
  527.  
  528. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\]
  529. "RestrictRun"=dword:00000001
  530.  
  531. [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\RestrictRun]
  532.  
  533. "1"="REGEDIT.EXE"
  534. "2"="POLEDIT.EXE"
  535. "3"="NETSCAPE.EXE"
  536. "4"="WORDPAD.EXE"
  537. "5"="EXPLORER.EXE"
  538.  
  539. ----------------------------<END>---------------------------------------------
  540.   If this has been inserted into the registry, nothing will run except the
  541.   applications you listed. I believe this modification kicks in after reboot.
  542.   This is really not an efficient method to go about locking out programs, and
  543.   I would advise using EXTREME caution when playing with this aspect.
  544.  
  545.   To disable a command prompt while in windows, you just need to set the value
  546.   called "Disabled" (under WinOldApp subkey) to dword 1.  The drawback to this
  547.   is that no dos-based programs or executables will run (due to the poss-
  548.   ibility that they might induce a shell).  This is good for security unless
  549.   old DOS-based apps are still being used.
  550.  
  551. Desktop Effects:
  552.   Sometimes, a good way to hinder a user's ability to do harm is to make it
  553.   harder to navigate through the hard drive.  One common trick is to remove
  554.   all of the desktop icons.  This makes it harder for them to execute 
  555.   anything that is not in the start menu, and makes it difficult to browse
  556.   through the hard drive.  If that's too drastic for you, you may just want
  557.   to hide all the drives under My Computer, and disallow "Entire Network"
  558.   browsing under Network Neighborhood.  There are many options.  All of
  559.   the below values are under Explorer unless noted by another subkey (i.e.
  560.   Network\NoNetHood)
  561.  
  562.     To do this:                                Set this value to a dword 1
  563.      Remove all desktop icons                   NoDesktop 
  564.      Hide all drives in My Computer             NoDrives
  565.      Hide Network Neighborhood                  Network\NoNetHood
  566.      Disable "Entire Network" in NetHood        Network\NoEntireNetwork
  567.  
  568. Start Menu stuff:
  569.   It's always nice to remove as many intrusive things from the Start Menu as
  570.   possible.  This is also achieved with policies.  Since the "Start Menu" and
  571.   taskbar are all handled by EXPLORER.EXE, these values will need to be under
  572.   the explorer subkey of policies.
  573.  
  574.     To do this:                                Set this value to a dword 1
  575.      Remove Run option from Start Menu          NoRun
  576.      Remove all folders from "Settings"*        NoSetFolders
  577.      Remove Taskbar Properties from "Settings"* NoSetTaskbar
  578.      Remove Find option from Start Menu         NoFind
  579.      Disable Shutdown Command%                  NoClose
  580.  
  581.   * if both values are set to 1, Settings will not show up on Start Menu
  582.   % This is not adviseable, as it is no longer possible to "correctly"
  583.     shut down the machine.
  584.  
  585. Another way to edit the registry is through an ".INF" file.  These files
  586. are similar to patch files, except for a few slight differences.
  587.  
  588. .REG (Patch) files and .INF files compared:
  589.  
  590. Similarities:
  591. Both can seriousely mess up a registry file
  592. Both can add values or edit existing values 
  593. Neither are restricted via the "DisableRegistryTools" stuff
  594.  
  595. Differences:
  596. .INF files are MUCH more difficult to create.
  597. .INF files can delete registry values and keys.
  598. .INF files need to be Right-Clicked and the "Install" option selected in
  599.      order to affect the registry, therefore they are a little safer.
  600.  
  601. Using .INF files for registry editing:
  602.  
  603. All .inf files start with:
  604. --------<CUT>---------
  605.  
  606. [Version]
  607. Signature="$Chicago$"
  608.  
  609. ----------------------
  610.  
  611. After that, you need to make a section called "DefaultInstall", and
  612. include the names of the sections that will hold registry editing
  613. Data.  Then you need to create the proper sections (Called Add.Entries
  614. and Del.Entries in this example).  If you place a semicolon (;) at the
  615. beginning of a line, it will be ignored, for commenting purposes.  Look
  616. at the following example:
  617. ------------------------------------------------------------------------
  618. [DefaultInstall]
  619. AddReg=Edd.Entries
  620. DelReg=Del.Entries
  621.  
  622. [Add.Entries]
  623. HKCU,Software\Microsoft\,BillShallDie,,"Down With Bill!!!"
  624.  
  625. ;Registry Entries are stored in the following format:
  626. ;Branch (Abbreviated), Key (Path), ValueName, ValueDataType, ValueData
  627. ;
  628. ;There are a few things that need explaining here.  The first is
  629. ;"Branch Abreviations", the next is "DataTypes".  Here We Go...
  630. ;
  631. ;Abbreviations:
  632. ;HKEY_CURRENT_USER   = HKCU
  633. ;HKEY_LOCAL_MACHINE  = HKLM
  634. ;HKEY_CURRENT_CONFIG = HKCC
  635. ;HKEY_USERS          = HKU
  636. ;HKEY_CLASSES_ROOT   = HKCR
  637. ;HKEY_DYN_DATA       = HKDD
  638. ;
  639. ;datatypes:
  640. ;0=string
  641. ;1=hex:01,ff,...
  642. ;2=string (but don't replace value if it already exists)
  643. ;3=hex (but don't replace value if it already exists)
  644. ; Note: As shown in the example, if the DataType value is left blank,
  645. ; A DataType value of "0" is assumed.
  646.  
  647. [Del.Entries]
  648. HKCU,Software\Microsoft\,BillShallDie
  649. ;The format for Delete Entries is similar:
  650. ;Branch (Abbreviated), Key (Path), ValueName
  651. ------------------------------------------------------------------------
  652.  
  653.  
  654.  
  655. Appendix B: Some final stuff
  656.  
  657. Although you might be able to restrict executables from being run with
  658. policies, in some cases, the shortcuts in help files will still allow
  659. an application to be run.
  660.  
  661. The registry is almost impossible to secure.  As noted in section I,
  662. it's fairly easy to mess around with the registry restrictions by using
  663. simple little patch files.  There are also rumors that Norton's Registry
  664. editor is fully capable and willing to mess with the registry, regard-
  665. less of the setting contained within the registry that supposedly will
  666. protect the registry from "Tools" that access the registry.
  667.  
  668. About policies, if the .POL files are stored on the local computer, and
  669. not on a network, then it's potentially easy for someone to locate and
  670. delete these files.  This would ultimately result in a loss of certain
  671. policiy restrictions.  If your Windows 95 machines are on a network, you
  672. would be wise to keep the policy files stored on the server, rather than
  673. on each machine.  Be sure to restrict user access to these files via
  674. your network's access restrictions.  This will make it more difficult to
  675. mess with the policies.
  676.  
  677.  
  678. Closing Remarks on Windows 95 Security
  679.  
  680. The point of this article was to bring to light some of the major security
  681. flaws that are associated with Windows 95.  There are some really good 
  682. 3rd party programs that will totally patch some of these holes and many
  683. others, but the programs themselves might have a few little flaws of their
  684. own.  Please do not rip any keys off of your keyboard, though.  Most of
  685. these little modifications do nothing more than keep the newbies and
  686. wanna-be's from being little destructive punks.  Some examples in here
  687. were simply to show you that no matter how hard you try, someone will
  688. almost inevitably find a way in if it means enough to them.  
  689.